import { createRouter,createWebHistory,RouteRecordRaw} from "vue-router";

//创还能数组 作用:为了组件匹配对应的路由
const routes :Array<RouteRecordRaw>=[
  {
    path:'/',
    component:()=>import('../components/HelloWorld.vue')
  },
  {
    path:"/ForDemo",
    component:()=>import('../components/ForDemo.vue')
  },
  {
    path:"/IFDemo",
    component:()=>import('../components/IFDemo.vue')
  },
  {
    path:'/RefDemo',
    component:()=>import('../components/RefDemo.vue')
  },
  {
    path:"/Demo",
    component:()=>import('../components/Demo.vue')
  },
  {
    path:'/EditStu/:id', 
    name:'EditStu',
    component:()=>import('../components/EditStu.vue')
  }
]

//创建路由
const router = createRouter({
  history:createWebHistory(),  //声明路由历史记录
  routes
})

//导出路由
export default router